package com.situ.study.day7.homework;

public class Number {
    private int num1;
    private int num2;

    public Number() {
    }

    public Number(int num1, int num2) {
        this.num1 = num1;
        this.num2 = num2;
    }

    public int add() {
        return num1 + num2;
    }

    //单一职责：一个类、一个方法应该只完成一个功能
    public void sub() {
        int result = num1 - num2;
        System.out.println(result);
    }

    public int getNum1() {
        return num1;
    }

    public void setNum1(int num1) {
        this.num1 = num1;
    }

    public int getNum2() {
        return num2;
    }

    public void setNum2(int num2) {
        this.num2 = num2;
    }
}
